import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'


Vue.use(Router)
const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  routes: [
   {
      path:'/',
      name:'login',
      component:()=>import('../components/login')
    }, {
      path:'/admin',
      name:'admin',
      component:()=>import('../components/admin'),
      children:[
        {
        path:'backuser',
        name:'后台用户',
        component:()=>import('../components/backuser')
       },{
        path:'menu',
        name:'菜单管理',
        component:()=>import('../components/menu')
      }
      ,{
        path:'eachrts',
        name:'图表统计',
        component:()=>import('../components/eachrts')
      },
      {
        path:'commentRecord',
        name:'评论审核记录',
        component:()=>import('../components/commentRecord')
      },
      {
        path:'videoRecord',
        name:'视频审核记录',
        component:()=>import('../components/videoRecord')
      },
      {
        path:'report',
        name:'举报管理',
        component:()=>import('../components/report')
      },{
        path:'dispose',
        name:'犯规处理',
        component:()=>import('../components/dispose')
      },{
        path:'foul',
        name:'犯规类型',
        component:()=>import('../components/foul')
      }
      // register.vue
      ,{
        path:'register',
        name:'视频播放',
        component:()=>import('../components/register')
      }
      ,{
        path:'role',
        name:'角色管理',
        component:()=>import('../components/role')
      }
      ,{
        path:'video',
        name:'视频审核',
        component:()=>import('../components/video')
      }
      ,{
        path:'video_type',
        name:'视频类型',
        component:()=>import('../components/video_type')
      }
      ,{
        path:'comment',
        name:'评论审核',
        component:()=>import('../components/comment')
      },{
        path:'welcome',
        name:'Welcome',
        component:()=>import('../components/welcome')
      }
    ]
    }
  ]
})
